package com.itheima.Test10;

public class Demo10 {
    public static void main(String[] args) {
        /*
        有以下数组：
		int[] arr = {10,27,8,5,2,1,3,55,88};
	    请定义一个新数组，长度为5，并将arr中几个连续的1位数的数字复制到新数组。
         */
        int[] arr = {10,27,8,5,2,1,3,55,88};
        int [] array = new  int[5];
        System.arraycopy(arr,2,array,0,5);
        for (int i = 0; i < array.length; i++) {
            System.out.println(array[i]);
        }
    }

    private static void method() {
        int[] arr = {10,27,8,5,2,1,3,55,88};
        int[] array =new  int [5];
        System.arraycopy(arr,2,array,0,5);
        for (int i = 0; i < array.length; i++) {
            System.out.print(array[i]+",");
        }
    }
}
